package club.justwill.single.persistence.support;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;

/**
 * Created by luoyu on 15-12-24.
 */
@MappedSuperclass
public class ProjectIncomeBase extends Jpo {


    @Column(name = "project_id")
    private Long projectId;

    @Column(name = "photo")
    private String photo;

    @Column(name = "name")
    private String name;

    @Column(name = "money")
    private Double money ;

    protected void copyBase(ProjectIncomeBase other) {
        setProjectId(other.getProjectId());
        setPhoto(other.getPhoto());
        setName(other.getName());
        setMoney(other.getMoney());
    }

    public Long getProjectId() {
        return projectId;
    }

    public void setProjectId(Long projectId) {
        if(this.projectId == null) {
            this.projectId = 0L;
        } else {
            this.projectId = projectId;
        }
    }

    public String getPhoto() {
        return photo;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Double getMoney() {
        return money;
    }

    public void setMoney(Double money) {
        this.money = money;
    }
}
